#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdlib>
#include <vector>
using namespace std;

#define SIZE 8

const int acceci[SIZE][SIZE] ={{ 2, 3, 4, 4, 4, 4, 3, 2},
                               { 3, 4, 6, 6, 6, 6, 4, 3},
                               { 4, 6, 8, 8, 8, 8, 6, 4},
                               { 4, 6, 8, 8, 8, 8, 6, 4},
                               { 4, 6, 8, 8, 8, 8, 6, 4},
                               { 4, 6, 8, 8, 8, 8, 6, 4},
                               { 3, 4, 6, 6, 6, 6, 4, 3},
                               { 2, 3, 4, 4, 4, 4, 3, 2}};
const int horizl[]           = {2, 1, -1, -2, -2, -1, 1, 2};
const int vertil[]           = {-1, -2, -2, -1, 1, 2, 2, 1};

#ifndef BOARD_H
#define BOARD_H

class board
{
public:
    board ();
    board (board&);
    void print ();
    int * operator [] (int index);

private:
    int chess_board[SIZE][SIZE];
};

#endif

#ifndef KNIGHT_H
#define KNIGHT_H

class knight
{
public:
    enum KNIGHT_FLAGS {PRINT_NONE, PRINT_ALL, PRINT_FULL};
    KNIGHT_FLAGS flags;

    knight (int = 0, int = 0);
    knight (knight&);
    void compute (int = -1);
    
private:
    int x, y;
    int ori_x, ori_y;
    int count;
    board chess_board;
    int acceci[SIZE][SIZE];

    void move (int);
    int access (int);
    void refresh_access ();
    void print_access ();
};

#endif
